#include <iostream>

using namespace std;

// Line抽象类
class Line {
	public:
		Line(int len = 0) : m_len(len) {}
		virtual int area(void) = 0;
		virtual int volumn(void) = 0;
	protected:
		int m_len;
};

// 抽象类
class Rect : public Line {
	public:
		Rect(int len, int width) : Line(len), m_width(width) {}
		int area(void) {return m_len * m_width;}
	
	protected:
		int m_width;
};

class Cuboid : public Rect {
	public:
		Cuboid(int len, int width, int height) : Rect(len, width), m_height(height) {}
		int area(void) {return 2 * (m_len * m_width + m_len * m_height + m_width * m_height);}
		int volumn(void) {return m_width * m_len * m_height;}
	protected:
		int m_height;
};


int main(void)
{
	// Rect r(1, 2);
	Cuboid c(1, 2, 3);

	cout << c.area() << endl;
	cout << c.volumn() << endl;

	return 0;
}

